<template>
    <div
        class="OnelockCard"
        v-loading="pageLoading"
        element-loading-background="rgba(255, 255, 255, 0.7)"
    >
        <el-card class="box-card">
            <div slot="headerss" class="clearfix text_fl">
                <span>一键锁卡</span>
                <el-button class="btn_close" type="text" @click="handleClose">关闭</el-button>
            </div>
            <div v-show="!CardSuccessInfo">
                <el-form
                    class="formTop"
                    ref="formData"
                    :inline="true"
                    label-position="right"
                    size="small"
                    :rules="rules"
                    :model="formData"
                >
                    <el-row>
                        <div class="text_center width30 dispy_in_bok" label-width="125px">
                            <el-form-item label="账户类别:" class="text_fl">
                                <el-select
                                    v-model="formData.CATEGORY"
                                    placeholder="请选择账户类别"
                                    clearable
                                    @change="getCATEGORYObj"
                                >
                                    <el-option
                                        v-for="item in AccountionTYPE_INFO"
                                        :label="item.label"
                                        :value="item.code"
                                        :key="item.code"
                                    ></el-option>
                                </el-select>
                            </el-form-item>
                        </div>
                        <div class="text_center width30 dispy_in_bok">
                            <el-form-item label="卡号:" class="text_fl">
                                <el-select
                                    v-model.trim="formData.CARDNO"
                                    placeholder="请选择卡号"
                                    clearable
                                    @change="getCARDNBRFun"
                                >
                                    <el-option
                                        v-for="item in cardList_option"
                                        :label="item.CARDNBR"
                                        :value="item.CARDNBR"
                                        :key="item.CARDNBR"
                                    ></el-option>
                                </el-select>
                            </el-form-item>
                        </div>
                    </el-row>
                    <el-row>
                        <div class="addressInfo">
                            <!-- 有卡消费 -->
                            <el-card class="box-card">
                                <div slot="header" class="clearfix">
                                    <span>有卡消费</span>
                                </div>
                                <div class="info">
                                    <el-form-item
                                        label="起始时间:"
                                        label-position="left"
                                        prop="FBPOSST"
                                    >
                                        <el-input
                                            v-model="formData.FBPOSST"
                                            @blur="formatTime($event)"
                                        ></el-input>
                                    </el-form-item>
                                    <el-form-item label="结束时间:" label-position="left">
                                        <el-input
                                            v-model="formData.FBPOSED"
                                            @blur="formatTime($event)"
                                        ></el-input>
                                    </el-form-item>
                                </div>
                            </el-card>

                            <!-- ATM交易 -->
                            <el-card class="box-card">
                                <div slot="header" class="clearfix">
                                    <span>ATM交易</span>
                                </div>
                                <div class="info">
                                    <el-form-item label="起始时间:" label-position="left">
                                        <el-input
                                            v-model="formData.FBATMST"
                                            @blur="formatTime($event)"
                                        ></el-input>
                                    </el-form-item>
                                    <el-form-item label="结束时间:" label-position="left">
                                        <el-input
                                            v-model="formData.FBATMED"
                                            @blur="formatTime($event)"
                                        ></el-input>
                                    </el-form-item>
                                </div>
                            </el-card>
                            <!-- 无卡交易 -->
                            <el-card class="box-card">
                                <div slot="header" class="clearfix">
                                    <span>无卡交易</span>
                                </div>
                                <div class="info">
                                    <el-form-item label="起始时间:" label-position="left">
                                        <el-input
                                            v-model="formData.NOCARDST"
                                            @blur="formatTime($event)"
                                        ></el-input>
                                    </el-form-item>
                                    <el-form-item label="结束时间:" label-position="left">
                                        <el-input
                                            v-model="formData.NOCARDED"
                                            @blur="formatTime($event)"
                                        ></el-input>
                                    </el-form-item>
                                </div>
                            </el-card>
                            <!-- 境外交易 -->
                            <el-card class="box-card">
                                <div slot="header" class="clearfix">
                                    <span>境外交易</span>
                                </div>
                                <div class="info">
                                    <el-form-item label="起始时间:" label-position="left">
                                        <el-input
                                            v-model="formData.FORINST"
                                            @blur="formatTime($event)"
                                        ></el-input>
                                    </el-form-item>
                                    <el-form-item label="结束时间:" label-position="left">
                                        <el-input
                                            v-model="formData.FORINED"
                                            @blur="formatTime($event)"
                                        ></el-input>
                                    </el-form-item>
                                </div>
                            </el-card>
                        </div>
                    </el-row>
                    <!-- 话术 -->
                    <div class="hstable_wrap" v-if="speechList.length!=0">
                        <el-table
                            :data="speechList"
                            border
                            stripe
                            header-row-class-name="headerRow"
                            ref="showListTable"
                            class="heard-bg business_table hstable"
                            @selection-change="handleSelectionChange"
                        >
                            <el-table-column type="selection" label=" " min-width="55"></el-table-column>
                            <el-table-column label="业务话术">
                                <template slot-scope="scope">{{scope.row.content}}</template>
                            </el-table-column>
                        </el-table>
                    </div>
                    <div class="text_center content_top">
                        <el-button class="butclass" type="primary" @click="handleClickAllLock">一键全锁</el-button>
                        <el-button
                            class="butclass"
                            type="primary"
                            @click="handleClickAllSolution"
                        >一键全解</el-button>
                        <el-button class="butclass" type="primary" @click="handleClickbtn">自定义锁卡</el-button>
                    </div>
                </el-form>
            </div>
            <div v-if="CardSuccessInfo">
                <OneLockCardItem :CardSuccessInfo="CardSuccessInfo" :lockType="lockType"></OneLockCardItem>
            </div>
            <el-dialog
                v-if="this.lockType==='1'"
                v-drag
                title="自定义锁卡"
                :visible.sync="centerDialogVisible"
                width="500px"
                :append-to-body="true"
                top="30vh"
                :close-on-click-modal="false"
                center
            >
                <p>
                    卡号：
                    <span>{{formData.CARDNO}}</span>
                </p>
                <p>
                    账户类别：
                    <span>{{formData.CATEGORY_filter}}</span>
                </p>

                <p class="text_center padding_top15">
                    <span style="color:#3a8ee6; ">锁卡后客户的信用卡将被限制支付,您确定对该卡号进行锁卡操作？</span>
                </p>
                <span slot="footer" class="dialog-footer">
                    <el-button
                        size="small"
                        icon="el-icon-circle-close"
                        @click="centerDialogVisible = false"
                    >取 消</el-button>
                    <el-button
                        type="primary"
                        size="small"
                        @click="submitFormReissueCard"
                        icon="el-icon-circle-check"
                    >确定</el-button>
                </span>
            </el-dialog>
            <el-dialog
                v-if="this.lockType==='2'"
                v-drag
                title="一键锁卡"
                :visible.sync="centerDialogVisible"
                width="500px"
                :append-to-body="true"
                top="30vh"
                :close-on-click-modal="false"
                center
            >
                <p>
                    卡号：
                    <span>{{formData.CARDNO}}</span>
                </p>
                <p>
                    账户类别：
                    <span>{{formData.CATEGORY_filter}}</span>
                </p>

                <p class="text_center padding_top15">
                    <span style="color:#3a8ee6; ">锁卡后客户的信用卡将被限制支付,您确定对该卡号进行锁卡操作？</span>
                </p>
                <span slot="footer" class="dialog-footer">
                    <el-button
                        size="small"
                        icon="el-icon-circle-close"
                        @click="centerDialogVisible = false"
                    >取 消</el-button>
                    <el-button
                        type="primary"
                        size="small"
                        @click="submitFormReissueCard"
                        icon="el-icon-circle-check"
                    >确定</el-button>
                </span>
            </el-dialog>
            <el-dialog
                v-if="this.lockType==='3'"
                v-drag
                title="一键解锁"
                :visible.sync="centerDialogVisible"
                width="500px"
                :append-to-body="true"
                top="30vh"
                :close-on-click-modal="false"
                center
            >
                <p>
                    卡号：
                    <span>{{formData.CARDNO}}</span>
                </p>
                <p>
                    账户类别：
                    <span>{{formData.CATEGORY_filter}}</span>
                </p>

                <p class="text_center padding_top15">
                    <span style="color:#3a8ee6; ">解锁后客户的信用卡将取消所有限制支付,您确定对该卡号进行解锁操作？</span>
                </p>
                <span slot="footer" class="dialog-footer">
                    <el-button
                        size="small"
                        icon="el-icon-circle-close"
                        @click="centerDialogVisible = false"
                    >取 消</el-button>
                    <el-button
                        type="primary"
                        size="small"
                        @click="submitFormReissueCard"
                        icon="el-icon-circle-check"
                    >确定</el-button>
                </span>
            </el-dialog>
        </el-card>
    </div>
</template>
<script>
import { mapGetters } from 'vuex';
import {
    closePage, getDictSelectList, itoStr, getDictMappingValue,
} from '@/utils/Common';
import OneLockCardItem from './components/OneLockCardItem'
export default {
    name: 'OnelockCard',
    data() {
        const validatorTM = (rule, value, callback) => {
            value = value.trim();
            console.log("表单校验", value);
            if (value.indexOf(':') !== -1) {
                value = value.substring(0, 2) + '' + value.substring(3, 5);
            }
            if (parseInt(value) > 2359) {
                callback(new Error('时间格式非法，请重新输入!'));
            } else {
                callback();
            }

        };
        return {
            formData: {
                CARDNO: '',
                CATEGORY_filter: '',
                CATEGORY: '',
                FBPOSST: '',//禁止有卡消费时间段（开始）
                FBPOSED: '',//禁止有卡消费时间段（结束）
                FBATMST: '',//禁止ATM交易时间段（开始）
                FBATMED: '',//禁止ATM交易时间段（结束）
                NOCARDST: '',//禁止无卡交易时间段（开始）
                NOCARDED: '',//禁止无卡交易时间段（结束）
                FORINST: '',//禁止境外交易时间段（开始）
                FORINED: '',//禁止境外交易时间段（结束）
            },
            pageLoading: false,
            centerDialogVisible: false,
            // centerDialogVisibleFlag: false,
            CardSuccessInfo: '',
            tableData: [],//
            newCardInfo_3004: '',//每次换卡的默认卡信息
            cardList_option: '',//当前账户下的所有的卡
            lockType: '',//锁卡状态
            UpDateCard_3014: '',// 更换卡号后 更新3014 数据
            speechList: [],//话术列表
            selectedList: [],
            MenuId: '',

            rules: {
                FBPOSST: [
                    { pattern: /^[0-2]\d{3}|[0-2]\d:\d{2}$/, message: '请输入正确的时间HHmm或HH:mm', trigger: 'blur' },
                    { validator: validatorTM, trigger: 'blur' }
                ],
                FBPOSED: [
                    { pattern: /^[0-2]\d{3}|[0-2]\d:\d{2}$/, message: '请输入正确的时间HHmm或HH:mm', trigger: 'blur' },
                    { validator: validatorTM, trigger: 'blur' }
                ],
                FBATMST: [
                    { pattern: /^[0-2]\d{3}|[0-2]\d:\d{2}$/, message: '请输入正确的时间HHmm或HH:mm', trigger: 'blur' },
                    { validator: validatorTM, trigger: 'blur' }
                ],
                FBATMED: [
                    { pattern: /^[0-2]\d{3}|[0-2]\d:\d{2}$/, message: '请输入正确的时间HHmm或HH:mm', trigger: 'blur' },
                    { validator: validatorTM, trigger: 'blur' }
                ],

                NOCARDST: [
                    { pattern: /^[0-2]\d{3}|[0-2]\d:\d{2}$/, message: '请输入正确的时间HHmm或HH:mm', trigger: 'blur' },
                    { validator: validatorTM, trigger: 'blur' }
                ],
                NOCARDED: [
                    { pattern: /^[0-2]\d{3}|[0-2]\d:\d{2}$/, message: '请输入正确的时间HHmm或HH:mm', trigger: 'blur' },
                    { validator: validatorTM, trigger: 'blur' }
                ],
                FORINST: [
                    { pattern: /^[0-2]\d{3}|[0-2]\d:\d{2}$/, message: '请输入正确的时间HHmm或HH:mm', trigger: 'blur' },
                    { validator: validatorTM, trigger: 'blur' }
                ],
                FORINED: [
                    { pattern: /^[0-2]\d{3}|[0-2]\d:\d{2}$/, message: '请输入正确的时间HHmm或HH:mm', trigger: 'blur' },
                    { validator: validatorTM, trigger: 'blur' }
                ],
            },
        };
    },
    components: {
        OneLockCardItem,
    },
    filters: {
        filteTimeHHSS: (value) => {
            value = (`${value}`).trim();

            return value.substring(0, 2) + '' + value.substring(2, 4);
        },
    },
    computed: {
        ...mapGetters([
            'cardInfo_3004',
            'AccountionTYPE_INFO',
            'cardList_3601',
            'defaultParams',
            'CreditCardService_3014',
            'pinFlag',
            'isCurrentMenuInfo',
        ])
    },
    mounted() {
        this.MenuId = this.$route.params.id || '';
        this.pageLoading = true;
        this.setDefaultCardInfo();
        this.getInit();
        // this.getExecuteFun();
        this.getDictValue();
        // 赋值 tabledata
        this.setTableDataValue();

    },
    methods: {
        // 修改默认卡
        setDefaultCardInfo() {
            if (!this.newCardInfo_3004) {
                this.newCardInfo_3004 = this.cardInfo_3004;
            }
        },
        getInit() {
            // 获取卡号
            this.formData.CARDNO = this.newCardInfo_3004.CARDNO || this.newCardInfo_3004.CARDNBR;
            // 获取账户类型
            this.formData.CATEGORY = (this.newCardInfo_3004.CATEGORY + '').trim() || '';
            //卡片状态
            // this.Card_STAT = (this.newCardInfo_3004.CARDSTAT + '').trim();
            // 更新3014 的值到 UpDateCard_3014 里
            this.UpDateCard_3014 = JSON.parse(JSON.stringify(this.CreditCardService_3014));
            this.getCardListOption(this.formData.CATEGORY);

        },
        async getDictValue() {
            // 账户类型
            this.formData.CATEGORY_filter = await getDictMappingValue('CATE', this.newCardInfo_3004.CATEGORY, this);
            // 卡产品
            // this.PRODUCT_value = await getDictMappingValue('PRODUCT', this.newCardInfo_3004.PRODUCT, this);
            await this.getCARDNBRFun(this.formData.CARDNO);
            // 换卡费用代码
            // this.isREPLACEFEEOption = await getDictSelectList('REPFEE', this);
            this.pageLoading = false;
            await this.getspeechList();
        },
        //获取当前账户类型下 所有的卡 
        getCardListOption(CATEGORY_val) {
            this.cardList_option = this.cardList_3601.filter((item) => (item.CATEGORY + '').trim() === CATEGORY_val);
            console.log(" this.cardList_option ", this.cardList_option);
        },
        // 选择 选中的需要操作的卡 后
        async getCARDNBRFun(cardNo) {
            // 选中 需要操作的卡后 需要重新跑 3004接口
            console.log("cardNo", cardNo);
            this.formData.CARDNO = cardNo;
            await this.getCreditCardInfo3014();
            this.setTableDataValue();
        },
        //根据菜单id查询话术列表
        async getspeechList() {
            console.log("this.isCurrentMenuInfo.id", this.isCurrentMenuInfo.id);
            console.log("this.MenuId", this.MenuId);
            var checkParam = {
                'id': this.MenuId || this.isCurrentMenuInfo.id,
            };
            this.$post.busiMenu.getlistByMenuId(checkParam).then((res) => {
                console.log("话术查询结果：", res);
                if (res.status === 200) { // http通讯成功
                    if (res.data.status == 0) { // 业务请求成功
                        this.speechList = res.data.content;
                    }
                }
            });
        },
        handleSelectionChange(val) {
            this.selectedList = val;
        },
        // 设置 tableData 里的数据 跟着3014的值变
        setTableDataValue() {
            const FBPOSST = this.UpDateCard_3014.FBPOSST.trim() === '' ? '0000' : this.UpDateCard_3014.FBPOSST;
            const FBPOSED = this.UpDateCard_3014.FBPOSED.trim() === '' ? '0000' : this.UpDateCard_3014.FBPOSED;
            const FBATMST = this.UpDateCard_3014.FBATMST.trim() === '' ? '0000' : this.UpDateCard_3014.FBATMST;
            const FBATMED = this.UpDateCard_3014.FBATMED.trim() === '' ? '0000' : this.UpDateCard_3014.FBATMED;
            const NOCARDST = this.UpDateCard_3014.NOCARDST.trim() === '' ? '0000' : this.UpDateCard_3014.NOCARDST;
            const NOCARDED = this.UpDateCard_3014.NOCARDED.trim() === '' ? '0000' : this.UpDateCard_3014.NOCARDED;
            const FORINST = this.UpDateCard_3014.FORINST.trim() === '' ? '0000' : this.UpDateCard_3014.FORINST;
            const FORINED = this.UpDateCard_3014.FORINED.trim() === '' ? '0000' : this.UpDateCard_3014.FORINED;
            const tableCopy = [{
                FBPOTime: [FBPOSST, FBPOSED],
                FBATMTime: [FBATMST, FBATMED],
                NOCARDTime: [NOCARDST, NOCARDED],
                FORINTime: [FORINST, FORINED],
            }]
            console.log('tableCopy', tableCopy);
            this.tableData = Object.assign([], this.tableData, tableCopy)
            this.formData.FBPOSST = this.formatTM(FBPOSST);
            this.formData.FBPOSED = this.formatTM(FBPOSED);
            this.formData.FBATMST = this.formatTM(FBATMST);
            this.formData.FBATMED = this.formatTM(FBATMED);
            this.formData.NOCARDST = this.formatTM(NOCARDST);
            this.formData.NOCARDED = this.formatTM(NOCARDED);
            this.formData.FORINST = this.formatTM(FORINST);
            this.formData.FORINED = this.formatTM(FORINED);
            // this.UpDateCard_3014
        },

        // 获取账户类型
        getCATEGORYObj(val) {
            console.log('val', val);
            // 获取账户类型
            this.AccountionTYPE_INFO.some((item) => {
                if (item.code === val) {
                    this.CATEGORY_filter = item.label;
                    return true
                }
            });
            console.log('this.CATEGORY_filter', this.CATEGORY_filter);
            //获取当前账户类型下 所有的卡 
            this.getCardListOption(val);

        },
        // 自定义
        handleClickbtn() {
            this.$refs.formData.validate((valid) => {
                if (valid) {
                    if (this.selectedList.length != this.speechList.length) {
                        this.$alert('话术尚未全部勾选！', '提示', {
                            customClass: 'warning', type: 'warning',
                        });
                        return;
                    }
                    this.centerDialogVisible = true;
                    this.lockType = "1";
                }
            });

        },

        // 全锁
        handleClickAllLock() {
            this.$refs.formData.validate((valid) => {
                if (valid) {
                    if (this.selectedList.length != this.speechList.length) {
                        this.$alert('话术尚未全部勾选！', '提示', {
                            customClass: 'warning', type: 'warning',
                        });
                        return;
                    }
                    this.centerDialogVisible = true;
                    this.lockType = "2";
                }
            });
        },
        // 全解
        handleClickAllSolution() {
            this.$refs.formData.validate((valid) => {
                if (valid) {
                    if (this.selectedList.length != this.speechList.length) {
                        this.$alert('话术尚未全部勾选！', '提示', {
                            customClass: 'warning', type: 'warning',
                        });
                        return;
                    }
                    this.centerDialogVisible = true;
                    this.lockType = "3";
                }
            });
        },
        // 3014信用卡服务方式综合查询
        async getCreditCardInfo3014() {
            const defaultParamInfo = JSON.parse(JSON.stringify(this.defaultParams));
            defaultParamInfo.body.appHead.tranCode = '3014';// 修改交易号
            defaultParamInfo.body.appBody = {
                PINFLAG: '0',
                PIN: '',
                CARDNBR: this.formData.CARDNO,// 卡号
            };
            await this.$post.common.transPort(defaultParamInfo).then((res) => {
                // console.log(res);
                if (res.status === 200) { // 请求成功
                    const CreditCard = JSON.parse(res.data.jsonRes);
                    // console.log(CreditCard,'3014信用卡服务');
                    if (CreditCard.sysHead.rspCd == '000000') { // 交易成功
                        this.UpDateCard_3014 = CreditCard.body.appBody;
                        console.log(this.UpDateCard_3014, '3014信用卡服务');
                        // this.isShowSuccess=true;
                        // 更新vuex 数据
                        // this.$store.commit('common/UPDATE_CREDIT_CARD_SERVICE', CreditCard.body.appBody);
                    } else {
                    }
                }
            });
        },
        // 4078卡片账户资料修改交易接口
        submitFormReissueCard() {
            const defaultParams = JSON.parse(JSON.stringify(this.defaultParams));
            console.log("this.formData", this.formData);
            let paramsval = {};
            switch (this.lockType) {
                case '1':
                    const FBPOSST = this.formData.FBPOSST.length === 4 ? this.formData.FBPOSST : this.formData.FBPOSST.substring(0, 2) + '' + this.formData.FBPOSST.substring(3, 5);
                    const FBPOSED = this.formData.FBPOSED.length === 4 ? this.formData.FBPOSED : this.formData.FBPOSED.substring(0, 2) + '' + this.formData.FBPOSED.substring(3, 5);
                    const FBATMST = this.formData.FBATMST.length === 4 ? this.formData.FBATMST : this.formData.FBATMST.substring(0, 2) + '' + this.formData.FBATMST.substring(3, 5);
                    const FBATMED = this.formData.FBATMED.length === 4 ? this.formData.FBATMED : this.formData.FBATMED.substring(0, 2) + '' + this.formData.FBATMED.substring(3, 5);
                    const NOCARDST = this.formData.NOCARDST.length === 4 ? this.formData.NOCARDST : this.formData.NOCARDST.substring(0, 2) + '' + this.formData.NOCARDST.substring(3, 5);
                    const NOCARDED = this.formData.NOCARDED.length === 4 ? this.formData.NOCARDED : this.formData.NOCARDED.substring(0, 2) + '' + this.formData.NOCARDED.substring(3, 5);
                    const FORINST = this.formData.FORINST.length === 4 ? this.formData.FORINST : this.formData.FORINST.substring(0, 2) + '' + this.formData.FORINST.substring(3, 5);
                    const FORINED = this.formData.FORINED.length === 4 ? this.formData.FORINED : this.formData.FORINED.substring(0, 2) + '' + this.formData.FORINED.substring(3, 5);
                    paramsval = {
                        CARDNO: this.formData.CARDNO, // 卡号
                        CARDNBR: this.formData.CARDNO, // 卡号
                        PINFLAG: this.pinFlag,
                        SEVOPT: '12',//修改项目  12：禁止有卡消费
                        CHKOPT: '0000000000',//检查项目
                        RMBBILL: '1',//外卡交易第一币种入账
                        SERCNT: '111111111111999999999999999999',//交易控制 服务种类
                        FBPOSST: FBPOSST,//禁止有卡消费时间段（开始）
                        FBPOSED: FBPOSED,//禁止有卡消费时间段（结束）
                        FBATMST: FBATMST,//禁止ATM交易时间段（开始）
                        FBATMED: FBATMED,//禁止ATM交易时间段（结束）
                        NOCARDST: NOCARDST,//禁止无卡交易时间段（开始）
                        NOCARDED: NOCARDED,//禁止无卡交易时间段（结束）
                        FORINST: FORINST,//禁止境外交易时间段（开始）
                        FORINED: FORINED,//禁止境外交易时间段（结束）
                    }
                    break;
                case "2": // 全锁
                    paramsval = {
                        CARDNO: this.formData.CARDNO, // 卡号
                        CARDNBR: this.formData.CARDNO, // 卡号
                        PINFLAG: this.pinFlag,
                        SEVOPT: '12',//修改项目  12：禁止有卡消费
                        CHKOPT: '0000000000',//检查项目
                        RMBBILL: '1',//外卡交易第一币种入账
                        SERCNT: '111111111111999999999999999999',//交易控制 服务种类
                        FBPOSST: '0000',//禁止有卡消费时间段（开始）
                        FBPOSED: '2359',//禁止有卡消费时间段（结束）
                        FBATMST: '0000',//禁止ATM交易时间段（开始）
                        FBATMED: '2359',//禁止ATM交易时间段（结束）
                        NOCARDST: '0000',//禁止无卡交易时间段（开始）
                        NOCARDED: '2359',//禁止无卡交易时间段（结束）
                        FORINST: '0000',//禁止境外交易时间段（开始）
                        FORINED: '2359',//禁止境外交易时间段（结束）
                    }
                    break;
                case "3": // 全解
                    paramsval = {
                        CARDNO: this.formData.CARDNO, // 卡号
                        CARDNBR: this.formData.CARDNO, // 卡号
                        PINFLAG: this.pinFlag,
                        SEVOPT: '12',//修改项目  12：禁止有卡消费
                        CHKOPT: '0000000000',//检查项目
                        RMBBILL: '1',//外卡交易第一币种入账
                        SERCNT: '111111111111999999999999999999',//交易控制 服务种类
                        FBPOSST: '0000',//禁止有卡消费时间段（开始）
                        FBPOSED: '0000',//禁止有卡消费时间段（结束）
                        FBATMST: '0000',//禁止ATM交易时间段（开始）
                        FBATMED: '0000',//禁止ATM交易时间段（结束）
                        NOCARDST: '0000',//禁止无卡交易时间段（开始）
                        NOCARDED: '0000',//禁止无卡交易时间段（结束）
                        FORINST: '0000',//禁止境外交易时间段（开始）
                        FORINED: '0000',//禁止境外交易时间段（结束）
                    }
                    break;
                default:
                    break;
            }
            console.log('paramsval', paramsval);
            defaultParams.body.appBody = Object.assign(this.defaultParams.body.appBody, paramsval);
            defaultParams.body.appHead.tranCode = '4078';// 修改交易号
            console.log(defaultParams);
            this.$post.common.transPort(defaultParams).then((res) => {
                if (res.status === 200) { // 请求成功
                    const onelock = JSON.parse(res.data.jsonRes);
                    if (onelock.sysHead.rspCd == '000000') { // 交易成功
                        console.log(onelock, 'onelock');
                        this.CardSuccessInfo = onelock;
                        this.CardSuccessInfo.CATEGORY_filter = this.formData.CATEGORY_filter;
                        // this.ReissueCardSuccess.CARDNO = this.formData.CARDNO;
                        // this.centerDialogVisibleFlag = true;
                    } else {
                        const ErrorMessage = `错误码：${onelock.sysHead.rspCd} ` + `错误信息：${onelock.sysHead.rspMsg}`;
                        this.$alert(ErrorMessage, onelock.sysHead.busiName, { customClass: 'error', type: 'error' });
                    }
                }
                this.centerDialogVisible = false; // 关闭弹框
            });
        },
        formatTime(event) {
            let value = event.target.value;
            console.log("格式化时间：" + value);
            this.$refs.formData.validate((valid) => {
                if (valid) {

                    event.target.value = this.formatTM(value);
                } else {
                    event.target.value = value;
                }
            });
        },

        formatTM(val) {
            if (val.indexOf(':') === -1) {
                return val.substring(0, 2) + ':' + val.substring(2, 4);
            } else {
                return val;
            }

        },
        // 点击关闭
        handleClose() {
            closePage(this.$route, this, 1);
        },
    }
}
</script>
<style lang='scss'>
.OnelockCard {
    .addressInfo {
        display: flex;
        justify-content: space-around;
        flex-wrap: wrap;

        .box-card {
            width: 18%;
            margin-bottom: 5px;
            .el-card__body {
                padding: 10px;
            }
            .info .el-form-item__label {
                width: 85px;
                line-height: 34px;
            }
            .info .el-form-item__content {
                margin-bottom: 15px;
            }
        }

        .el-input__inner {
            width: 100px;
            min-width: 100px;
            height: 36px;
            line-height: 36px;
        }
    }
    .butclass {
        margin-left: 20px;
    }
    .text_span {
        margin: 15px 20px;
        font-size: 16px;
    }
    .formTop {
        margin-top: 12px;
    }
    .pickertime {
        width: 100%;
    }
}
</style>